package com.idheima.lianxi;

import java.util.ArrayList;

public class Studentshixian implements Studentcaozuo {
    @Override
    public void print(ArrayList<Student> students) {
        System.out.println("==全班全部学生信息如下====");
        for (int i = 0; i < students.size(); i++) {
             Student student =students.get(i);
            System.out.println( "姓名："+student.getName()+"  性别："+student.getSex()+"  成绩："+student.getScore());
        }
        System.out.println("===============");
    }

    @Override
    public void Evaluation(ArrayList<Student> students) {
        double score=0.0;
        for (int i = 0; i < students.size(); i++) {
            Student student = students.get(i);
            score+=student.getScore();
        }
        System.out.println("全班平均成绩为："+score/students.size());
    }
}
